<?php

namespace App\Http\Controllers\Api;

use App\Models\Notice;
use App\Models\Renting;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class NoticeController extends Controller
{
    // 获取信息
    public function getinfo(Request $request)
    {
        $renting_id   = Renting::where('openid', $request->get('openid'))->value('id');
        $data = Notice::with('owner')->orderBy('book_time','desc')->where('renting_id',$renting_id)->get();
        return $data;
    }
}
